﻿
using Qiniu.RS;
//using Qiniu.Storage;
using Qiniu.Util;
using Swirebev.PhotoDownload.Common;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Text;

namespace Swirebev.PhotoDownload.Cloud
{
    class QiniuHelper
    {
        private bool _isProxy;
        public bool IsProxy
        {
            set
            {
                this._isProxy = value;
            }
        }

        private string gAccessKey;
        private string gSecretKey;
        private string gUrlPrefix;
        private WebProxy gWebProxy;
        public Mac gMac { private set; get; }
        public BucketManager BucketManager { private set; get; }

        public QiniuHelper(string strAccessKey, string strSecretKey, string strUrlPrefix)
        {
            this.gAccessKey = strAccessKey;
            this.gSecretKey = strSecretKey;
            this.gUrlPrefix = strUrlPrefix;

            this.gMac = new Mac(this.gAccessKey, this.gSecretKey);

            this.BucketManager = new BucketManager(gMac);//new BucketManager(gMac);

            //this.gWebProxy = new WebProxy();
            //Uri uri = new Uri(Settings.Instance.ProxyScheme + @"://" + Settings.Instance.ProxyUrl + @":" + Settings.Instance.ProxyPort);
            //this.gWebProxy.Address = uri;
            //this.gWebProxy.Credentials = new NetworkCredential(Settings.Instance.ProxyUserName, Settings.Instance.ProxyPassword);
            //this._isProxy = false;
        }
    }
}
